package com.bskj.kuaifu.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.bskj.common.bean.model.UserCoupon;
import com.bskj.common.service.IBaseService;

public interface IUserCouponService extends IBaseService<UserCoupon> {

	List<UserCoupon> find(UserCoupon userCoupon) throws Exception;

	List<UserCoupon> findCascade(UserCoupon userCoupon) throws Exception;

	/**
	 * 找出用户有效的停车券
	 * 
	 * @param parkLotCustomerId
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	UserCoupon getValidCoupon(Integer parkLotCustomerId, Integer userId, Date outTime) throws Exception;

	boolean getCouponLimitMoney(Integer id) throws Exception;

	boolean getCouponStatus(UserCoupon userCoupon) throws Exception;

	Date getValidDate(Integer id) throws Exception;

	/**
	 * 用户领券
	 * 
	 * @param userCoupon 券信息
	 * @param userId  用户ID
	 * @throws Exception
	 */
	@Transactional(rollbackFor=Exception.class)
	Map<String,Object> userReceiveCoupon(UserCoupon userCoupon, Integer userId, String carNo) throws Exception;
}
